using System;

using Sce.Pss.HighLevel.GameEngine2D;
using Sce.Pss.HighLevel.GameEngine2D.Base;
using Sce.Pss.HighLevel.Physics2D;

using Sce.Pss.Core;
using Sce.Pss.Core.Environment;
using Sce.Pss.Core.Graphics;
using Sce.Pss.Core.Imaging;
using Sce.Pss.Core.Input;
using System.IO;
using System.Net;
using System.Collections.Generic;
using Sce.Pss.HighLevel.GameEngine2D;
using Sce.Pss.HighLevel.GameEngine2D.Base;

namespace RedSkies
{
	public class StupidEnemySprite:CharacterSprite
	{
		int UpdateCounter;
		
		
		public StupidEnemySprite (TextureInfo textureInfo, Vector2 center, IWorldMatrix worldMatrix, int speed, SpriteList sp):base(
			false,textureInfo, center, worldMatrix, speed, sp)
		{			
		}
		
		public override Vector2 UpdatePosition ()
		{
			UpdateCounter++;
			
			if (UpdateCounter>300)
			{
				UpdateCounter=0;	
			}
			
			if (UpdateCounter<100)
			{
				if (!this.WillBeLeftCollision())
				{
					return new Sce.Pss.Core.Vector2(Position.X-1,Position.Y);
				}
			} else 
			if (UpdateCounter<200)
			{
				if (!this.WillBeRightCollision())
				{
					return new Sce.Pss.Core.Vector2(Position.X+1,Position.Y);
				}
			}
			return Position;
		}		
	}
}

